﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ETL.Business.Models;
using ETL.Common.Logging;
using ETL.DataAccess;
using ETL.Entity;

namespace ETL.Business.Helpers
{
    public class ClockOff
    {

        private readonly ProjectActualResourceUsageRepository _projectActualResourceUsageRepository;

        public ClockOff()
        {
            _projectActualResourceUsageRepository = new ProjectActualResourceUsageRepository();
        }
        public ClockOff(ProjectActualResourceUsageRepository projectActualResourceUsageRepository)
        {
            _projectActualResourceUsageRepository = projectActualResourceUsageRepository;
        }

        public virtual bool Execute(string userid, string username)
        {
            try
            {
                // try to get from db
                return _projectActualResourceUsageRepository.ClockOff(userid, username);
            }
            catch (Exception ex)
            {
                LogService.Service.Debug(ex);
                return false;
            }
        }
        
    }
}
